package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Basic;
import cn.wolfcode.crm.mapper.BasicMapper;
import cn.wolfcode.crm.service.IBasicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BasicServiceImpl implements IBasicService {

    @Autowired
    private BasicMapper mapper;

    public void save(Basic basic) {
        mapper.insert(basic);
    }

    public void delete(Long id) {
        mapper.deleteByPrimaryKey(id);
    }

    public void update(Basic basic) {
        mapper.updateByPrimaryKey(basic);
    }

    public Basic get(Long id) {
        Basic basic = mapper.selectByPrimaryKey(id);
        return basic;
    }

    public List<Basic> listAll() {
        List<Basic> list = mapper.selectAll();
        return list;
    }
}
